// components/showBuyList/showBuyList.js
const api = require("../../api/api")
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    showBuyList:{
      type:Array,
      value:[]
    },
    iid:{
      type:Number,
      value:[]
    },
    show:{
      type:Boolean,
      value:true
    }
  },
  
  data: {
   
  },
  methods: {
    do(e){   
      console.log(e.currentTarget.dataset.id)
      
        wx.showModal({
          title:'提示',
          content:'确定收货?',
          success:(res)=>{
            if (res.confirm) {
              console.log("确定")
              var that = this
              wx.request({
                url: api.changeOrderStatus.url,
                method:api.changeOrderStatus.method,
                data:{
                  id:e.currentTarget.dataset.id,
                  status:2
                },
                success:res=>{
                  console.log(res)
                  this.triggerEvent('lisConOrder',2)
                  console.log(e.currentTarget.dataset.id)
                }
              })
            } else if(res.cancel) {
              console.log("取消")
            }
          }
        })
      
    }
  }
})
